<?php
header("Content-type: application/json");
header("Access-Control-Allow-Credentials: true");
header("Access-Control-Allow-Origin: *");
header("Access-Control-Request-Methods:GET, POST, PUT, DELETE, OPTIONS");
header('Access-Control-Allow-Headers:x-requested-with,content-type,test-token,test-sessid');

chdir(dirname(__FILE__));

include_once('./config.php');
include_once('./logfile.php');
include_once('./database.php');

$post = json_decode(file_get_contents('php://input'));
// if (conf('debug')) logfile('PORTAL_INPUT', var_export($post, true));
//if (conf('debug')) logfile();

function output($obj)
{
    echo json_encode($obj, JSON_UNESCAPED_UNICODE);
}
